using full_leaf_framework.Scene;
using full_leaf_framework.Visual;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace tile_map;

public class Hina : Building {

    public AnimationTrack track;
    public float animationTime = 0f;

    public override void StartBuilding(AnimatedSprite currentAnimation,
        Vector2 pos,
        Vector2 anchorPoint,
        float sizeScale,
        float angle = 0,
        SpriteEffects effects = SpriteEffects.None,
        int layer = 0) {
            base.StartBuilding(currentAnimation, pos, anchorPoint, sizeScale, angle, effects, layer);
            var tracks = AnimationInfo.LoadAnimationInfo("Data/Animation/hina_move.json");
            track = tracks.ReturnAnimationTrack("hina_move");
    }

    public override void Update(GameTime gameTime) {
        base.Update(gameTime);
        animationTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
        if (animationTime > 2f) { animationTime = 0f; }
        track.AffectDrawable(drawable, animationTime);
    }

}